package com.soms.service.impl;

import java.util.List;

import com.soms.dao.IMachineDAO;
import com.soms.domain.Machine;
import com.soms.service.IMachineService;

public class MachineServiceImpl implements IMachineService {
	private IMachineDAO machineDAO;
	
	public Machine getMachine(String guid) {
		return machineDAO.findById(guid);
	}

	public List<Machine> getAllMachine() {
		return machineDAO.findAll(Machine.class);
	}


	public void addMachine(Machine machine) {
		machineDAO.save(machine);
	}


	public void updateMachine(Machine machine) {
		machineDAO.saveOrUpdate(machine);
	}


	public void deleteMachine(Machine machine) {
		machineDAO.delete(machine);
	}

}
